package co.edu.usbcali.egrapico.vista.ambient;

import co.edu.usbcali.egrapico.vista.tools.JPanelTranferHandlerForward;

public class PanelPrecedentForward extends javax.swing.JInternalFrame {

    LPanePrecedentForward layeredPane;
    javax.swing.JScrollPane scroll1;
    private int restriction = 0;

    /**
     * Creates a new instance of PanelDragAndDrop
     */
    public PanelPrecedentForward() {
        super("",//+(++openFrameCount) 
                true, //resizable
                true, //closable
                true, //maximizable
                true);//iconifiable
        scroll1 = new javax.swing.JScrollPane();
        scroll1.setAutoscrolls(true);
        layeredPane = new LPanePrecedentForward();
        scroll1.setViewportView(layeredPane);
        getContentPane().add(scroll1);
        setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
        setTransferHandler(new JPanelTranferHandlerForward());
        setSize(300, 300);
        //Set the window's location.
        setLocation(30, 30);
        setVisible(true);

    }

    public LPanePrecedentForward getLPane() {
        return layeredPane;
    }

    public void addMyListenerToLPane() {
        setTransferHandler(new JPanelTranferHandlerForward());
        layeredPane.addMyListener();
    }

    public void addLayeredPane(LabelRestrictionF label) {
        label.setNameParent(getTitle());
        if (label.getName().equals("Forward")) {
            label.setName(label.getName() + (++restriction));
            label.setText(label.getName());
            label.setTextToolTip(label.getName() + ": ");
        }
        layeredPane.addLabel(label);
        layeredPane.addLabeltoVector(label);
        try {
            setSelected(true);
        } catch (java.beans.PropertyVetoException e) {
        }
    }

    public void setUndoLPane() {
        layeredPane.Undo();
    }

    public void setRedoLPane() {
        layeredPane.Redo();
    }

    public int getRedosize() {
        return layeredPane.getRedoSize();
    }

    public int getUndosize() {
        return layeredPane.getUndoSize();
    }
}